package cm.mefobe.android.telecomcost.entities;

import java.util.Calendar;

public class Time {
	private int _hour;
	private int _minute;
	
	public Time()
	{
		_hour = 0;
		_minute = 0;
	}
	
	public Time(int hour,int minute)
	{
		setHour(hour);
		setMinute(minute);
	}
	
	public static Time current()
	{
		Calendar cal = Calendar.getInstance();				
		return new Time(cal.get(Calendar.HOUR_OF_DAY),cal.get(Calendar.MINUTE));
	}

	public void setHour(int hour) {		
		this._hour = hour;
	}

	public int getHour() {
		return _hour;
	}

	public void setMinute(int _minute) {
		this._minute = _minute;
	}

	public int getMinute() {
		return _minute;
	}

	@Override
	public String toString() {
		String hour = (String) (getHour() < 10 ? "0" + getHour() : Integer.toString(getHour()));
		String minutes = (String) (getMinute() < 10 ? "0" + getMinute() : Integer.toString(getMinute()));
		return hour + ":" + minutes;
	}
}
